//
//  YZMRedPacketInfor.m
//  YZMicroStock
//
//  Created by apple on 17/5/10.
//  Copyright © 2017年 cqjr. All rights reserved.
//

#import "YZMRedPacketInfor.h"
#import "NSNumber+Utils.h"

@implementation YZMRedPacketInfor

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
    
    return @{
             @"tipBalance": @"tipBalance",
             @"tipAllBalance": @"tipAllBalance",
             @"tipCount": @"tipCount"
             };
}

- (void)setNilValueForKey:(NSString *)key {
    
}

- (NSMutableAttributedString *)showAttString:(NSString *)str {
    
    if ([@(self.tipAllBalance) isGreaterThanDouble:0]) {
        
        return [YZMAppStyle AttributedAndStr:str andAttributeStyle:@[@{@"font":[YZMAppStyle fontWithSize:24], @"range":[NSValue valueWithRange:NSMakeRange(0, str.length - 1)]}, @{@"color":[YZMAppStyle colorForRiseText], @"range":[NSValue valueWithRange:NSMakeRange(0, str.length)]}]];
    } else {
        
        return [YZMAppStyle AttributedAndStr:str andAttributeStyle:@[@{@"font":[YZMAppStyle fontWithSize:24], @"range":[NSValue valueWithRange:NSMakeRange(0, str.length - 1)]}]];
    }
    
    return nil;
}

@end
